// vuex 用户模块
import { getToken, setToken, removeToken } from '@/utils/storage'
const state = {
  // token数据
  tokenInfo: getToken() || {},
}
const mutations = {
  // 设置token信息
  setTokenInfo(state, tokenObj) {
    state.tokenInfo = tokenObj
    setToken(tokenObj)
  },

  // 移除token信息
  removeTokenInfo(state) {
    state.tokenInfo = {}
    removeToken()
  },
}
const getters = {}
const actions = {}

export default {
  namespaced: true,
  state,
  mutations,
  getters,
  actions,
}
